package com.yunfangdata.service.impl;

import com.yunfangdata.domain.PersonageSalary;
import com.yunfangdata.domain.Staff;
import com.yunfangdata.mapper.PersonageSalaryMapper;
import com.yunfangdata.mapper.StaffMapper;
import com.yunfangdata.query.QueryObject;
import com.yunfangdata.service.IPersonageSalaryService;
import com.yunfangdata.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonageSalaryServiceImpl implements IPersonageSalaryService {


    @Autowired
    private PersonageSalaryMapper mapper;
    @Autowired
    private StaffMapper staffMapper;


    public void save(PersonageSalary entity ,Long staffId) {
        mapper.insert(entity);
        staffMapper.updateByPersonageSalaryId(entity.getId(),staffId);

    }


    public void update(PersonageSalary entity,Long staffId) {
        mapper.updateByPrimaryKey(entity);
        staffMapper.updateByPersonageSalaryId(entity.getId(),staffId);
    }

   
}

